﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Shell.Structure
{
    public class ConditionDef
    {
        public string Name { get; set; }
        public Point Pos { get; set; }
        public double RGB { get; set; }
        public bool IsPassed { get; set; }

        public ConditionDef(string name, string pos, string rgb)
        {
            Name = name;
            string[] ps = pos.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            Pos = new Point(Convert.ToInt32(ps[0]), Convert.ToInt32(ps[1]));

            string[] cs = rgb.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int index = 0; index < cs.Length; index++)
            {
                RGB += Convert.ToInt32(cs[index]) * Math.Pow(16, index * 2);
            }
        }
    }
}
